package com.company;

import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.KeyEvent;

public class TabbedPane extends JPanel {
    static Fun_g g;
    static Fun_p p;

    public TabbedPane() {
        super(new GridLayout(1, 1));
        JTabbedPane tabbedPane = new JTabbedPane();
        g = new Fun_g();
        tabbedPane.addTab("勾核", g);
        tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
        p = new Fun_p();
        tabbedPane.addTab("配发", p);
        tabbedPane.addTab("查询及导出", new Fun_sel());
        tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
        add(tabbedPane);
    }

    public static void closeP() {
        if (p != null) {
            p.closeSocket();
        }
    }

    public static void closeG() {
        if (g != null) {
            g.closeSocket();
        }
    }
}
